package progress.exa27_4;

import java.util.TreeMap;

public class TreeMapStudy {
    public static void main(String[] args) {
        TreeMap<Integer,Integer> map = new TreeMap<>();
        //测试存储效率
        long start = System.currentTimeMillis();
        for(int i=0;i<10000000;i++){
            map.put(i+ (int) (Math.random() * 100),i);
        }
        long end1 = System.currentTimeMillis();
        System.out.println("存储耗时： "+ (end1-start)+"ms");
        for(int i=0;i<10000000;i++){
            map.get(i);
        }
        System.out.println("查询耗时："+(System.currentTimeMillis()-end1)+"ms");
    }
}
